Programs and data requiring copyright protection or highly confidential data are transmitted and received over networks, and recorded in compact disc-read only memory (CD-ROM) or other recording media and commercially distributed. Such data can be accessed and falsified by a third party unauthorized to access the data. To prevent this, the data are encrypted.
Data to be communicated is encrypted, for example as described with reference to FIG. 15. Initially, the sender reads data to be encrypted (step (S)1001) and a hash function is used to calculate a message digest (MD), a check character string for detection of falsification (S1002). Falsification may be detected by an approach other than calculating an MD. It may be detected by a different approach for example utilizing a cyclic redundancy check (CRC) code. The data to be encrypted is then encrypted in accordance with a prescribed encryption technique (S1003) and to the encrypted data the MD obtained at S1002 is attached and they are thus transmitted to a counterpart (S1004).
The recipient effects an inverted version of this process, although not shown. More specifically, the recipient having received encrypted data initially performs a decryption process and then calculates an MD. This calculated MD and the MD attached to the received encrypted data are compared. If they match, a decision is made that the received data is normal data free of falsification.
FIG. 16 schematically shows the above described data flow. In FIG. 16, data to be encrypted 101 is previously divided into z subdata Ni, wherein i=1 to z. At S1 and S2, for each data Ni a hash function is used to perform a hash function process, and encryption process information and a parameter modification portion are used to perform an encryption process. As a result, encrypted data Mi is generated, wherein i=1 to z. In doing so, the hash function process's final result is attached as a falsification detecting check character string MD to encrypted data M1-Mz to complete encrypted data 102. To decrypt encrypted data 102, initially at S3 encrypted data Mi is subjected to a decryption process using decryption process information and a parameter modification portion to obtain decrypted data 103 formed of data Pi, wherein i=1 to z. Then at S4 all data Pi undergo a hash function process to calculate check character string MD. The calculated check character string MD are compared with the falsification detecting check character string MD included in encrypted data 102 and if the MDs match then a decision is made that encrypted data M1-Mz are not falsified data and if the MDs fail to match then a decision is made that the data are falsified data.
The above described conventional encryption process requires two steps: calculating a falsification detecting check character string, and encrypting data. The decryption process also requires the two steps of decrypting data and calculating a falsification detecting check character string for comparison. Each of these steps has a significantly large amount of processing, and apparatuses performing encryption and decryption processes would require long periods of time before they complete encryption for transmission and decryption for reproduction. This is an obstacle to performing in real time a process, for example distributing content from a server via a network to a mobile terminal corresponding to a client, and immediately reproducing the content at the mobile terminal. In other words, the mobile terminal, having a low processing capability, requires a long period of time to reproduce the received content, which provides poor practical utility.
Furthermore, content legitimately obtained can nevertheless have its data partially lost or replaced with other data during transmission and reception via a network or in a medium having the content storing therein. In that case, to again obtain the legitimate content, the content's entire data must be received and a significantly long period of time is accordingly consumed to transfer the data.
Japanese Patent Laying-Open No. 2000-122861 discloses a technique employed to prevent falsification of software, data and the like. In this technique, such a hash function as described above is utilized to detect falsification. Furthermore in this technique data to be encrypted is divided into a plurality of blocks each serving as a unit and whenever a block is subjected to an encryption process the block's encryption key is calculated, which is significantly time consuming.